import Mock from "mockjs";

let list = []

export default {
    getStatisticalData:() => {
        for (let i = 0; i < 7; i++){
            list.push(
                Mock.mock({
                    '苹果':Mock.Random.float(100,8000,0,0),
                    'vivo':Mock.Random.float(100,8000,0,0),
                    'oppo':Mock.Random.float(100,8000,0,0),
                    '三星':Mock.Random.float(100,8000,0,0),
                    '小米':Mock.Random.float(100,8000,0,0),
                    '魅族':Mock.Random.float(100,8000,0,0),
                })
            )
        }
        return {
            code:20000,
            data:{
                //饼图
                videoData:[
                    {
                        name:'小米',
                        value:2999
                    },
                    {
                        name:'苹果',
                        value:9999
                    },
                    {
                        name:'vivo',
                        value:3599
                    },
                    {
                        name:'oppo',
                        value:3999
                    },
                    {
                        name:'三星',
                        value:4999
                    },
                    {
                        name:'魅族',
                        value:6999
                    }
                ],
                //柱状图
                userData:[
                    {
                        date:'周一',
                        new:5,
                        active:200
                    },
                    {
                        date:'周二',
                        new:2,
                        active:100
                    },
                    {
                        date:'周三',
                        new:15,
                        active:600
                    },
                    {
                        date:'周四',
                        new:9,
                        active:180
                    },
                    {
                        date:'周五',
                        new:16,
                        active:650
                    },
                    {
                        date:'周六',
                        new:13,
                        active:560
                    },
                    {
                        date:'周日',
                        new:20,
                        active:1230
                    },
                ],
                //折线图
                orderData: {
                    date:['2019-10-01','2019-10-02','2019-10-03','2019-10-04','2019-10-05','2019-10-06','2019-10-07'],
                    data:list
                },
                tableData:[
                    {
                        name:'oppo',
                        todayBuy:500,
                        monthBuy:3500,
                        totalBuy:22000
                    },
                    {
                        name:'vivo',
                        todayBuy:600,
                        monthBuy:4500,
                        totalBuy:56000
                    },
                    {
                        name:'苹果',
                        todayBuy:800,
                        monthBuy:6000,
                        totalBuy:49000
                    },
                    {
                        name:'小米',
                        todayBuy:900,
                        monthBuy:7500,
                        totalBuy:98000
                    },
                    {
                        name:'三星',
                        todayBuy:307,
                        monthBuy:4209,
                        totalBuy:34000
                    },
                    {
                        name:'魅族',
                        todayBuy:200,
                        monthBuy:2600,
                        totalBuy:17000
                    },
                ]
            }
        }
    }
}

